﻿<%@ Page  Title="" Language="C#" 
    MasterPageFile="~/Medianamik/MasterPages/MedianamikModalWindow.Master" 
    AutoEventWireup="true" CodeBehind="SearchResourceWindow.aspx.cs" 
    Inherits="Medianamik.UI.Web.ModalWindows.SearchResourceWindow" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ContentPlaceHolderID="HeaderContentHolder" runat="server">
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">
	    <script type="text/javascript">
	        //<![CDATA[
	        function GetRadWindow() {
	            var oWindow = null;
	            if (window.radWindow) oWindow = window.radWindow;
	            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
	            return oWindow;
	        }

	        function Cancel_Clicked() {
	            var oWindow = GetRadWindow();
	            oWindow.argument = null;
	            oWindow.Close();
	        }

	        function closeWindow(reloadType) {
	            var arg = new Object();
	            arg.reloadType = reloadType;
	            var oWindow = GetRadWindow();
	            oWindow.Close(arg);
	        }
	        //]]>           
	    </script>
	</telerik:RadScriptBlock>
	<style type="text/css">
	    #ModalBody
	    {
	        margin:0 12px 12px 12px;
	    }
	</style>
</asp:Content>

<asp:Content ContentPlaceHolderID="CenterContent" runat="server">
    <asp:ScriptManager ID="MedianamikScriptManager" EnableHistory="true" 
        EnablePageMethods="true" runat="server"  EnablePartialRendering="true" 
        ScriptMode="Release" />
    <fieldset>
        <h3><%= Resources("Medianamik_ResourceManagement", "SearchResults") %></h3>
        <telerik:RadGrid ID="SearchResults" 
                         runat="server" 
                         OnNeedDataSource="RefreshList"
                         OnItemCommand="LoadResource"
                         AutoGenerateColumns="false"
                         AllowSorting="true" 
                         AllowPaging="false" 
                         Skin="Medianamik" 
                         EnableEmbeddedSkins="false">
            <MasterTableView>
                <NoRecordsTemplate>
                    <%= Resources("Medianamik_ResourceManagement", "NoSearchResults") %>
                </NoRecordsTemplate>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText='<%$ Resources : Medianamik_ResourceManagement, ResourceId %>' DataField="ResourceId" SortExpression="ResourceId">
                        <ItemTemplate>
                            <asp:LinkButton ID="LoadResourceLink" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ResourceId") %>' CommandName="Load" CommandArgument='<%#string.Format("LoadResource;{0};{1}", ((System.Data.DataRowView)Container.DataItem)["ResourceSet"], ((System.Data.DataRowView)Container.DataItem)["ResourceId"]) %>'></asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="ResourceSet" HeaderText='<%$ Resources : Medianamik_ResourceManagement, ResourceSet %>'></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LocaleId" HeaderText='<%$ Resources : Medianamik_ConfigurationManagement, Language %>' ItemStyle-Width="10%"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Value" HeaderText='<%$ Resources : Medianamik_ResourceManagement, Value %>' ItemStyle-Width="30%"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </fieldset>
</asp:Content>
